using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace org.synthful.Windows
{
    /// <summary>
    /// Offered under Apache Public Licence 2.0
    /// synthful.org
    /// blessedgeek [@] synthful.org
    /// </summary>
    static public class Utils
    {
        static public bool withinDragAllowance(Point p1, Point p2)
        {
            return
            (
                Math.Abs(p1.X - p2.X) <=
                    SystemInformation.DragSize.Width &&
                Math.Abs(p1.Y - p2.Y) <=
                    SystemInformation.DragSize.Height
            );
        }

        static public bool typeIsAssignableFromObject(Type c, object o)
        {
            if (c.IsAssignableFrom(o.GetType()))
                return true;
            return false;
        }
    }
}
